home *** CD-ROM | disk | FTP | other *** search
- /* Example OASYS code by Russell Wallace 31 Jan 1991
- This code is in the public domain
- */
-
- class player {}
- class room {}
-
- property object in
- property object n
- property object s
- property string desc
-
- object room1
- object room2
-
- method look verbs {{look}}
- {
- print this in desc
- print "\n"
- }
-
- method save verbs {{save}}
- {
- save
- }
-
- method load verbs {{load} {restore}}
- {
- if load
- this look
- }
-
- method quit verbs {{quit}}
- {
- quit
- }
-
- method go_north verbs {{n} {north} {go north}}
- {
- if not this in n exists
- {
- print "You can't go that way.\n"
- return
- }
- this in = this in n
- this look
- }
-
- method go_south verbs {{s} {south} {go south}}
- {
- if not this in s exists
- {
- print "You can't go that way.\n"
- return
- }
- this in = this in s
- this look
- }
-
- method init
- {
- print "Game starting ...\n"
- player = create player
- room1 = create room
- room2 = create room
- room1 n = room2
- room2 s = room1
- room1 desc = "Room 1"
- room2 desc = "Room 2"
- player in = room1
- player look
- }
-